From: Bartosz Dziewoński Date: Sun, 13 Oct 2013 20:51:55 +0000 (+0200) Subject: Set 'watchcreations' and 'watchdefault' options to true X-Git-Tag: 1.31.0-rc.0~17717 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=10c9af4ed4d302f41cb674742486f2d9df02136a;p=lhc%2Fweb%2Fwiklou.git Set 'watchcreations' and 'watchdefault' options to true Also modify unit tests to be more resilient to various other tests automatically having their pages being watched. Co-authored-by: Bartosz Dziewoński Co-authored-by: Brian Wolff Bug: 45020 Change-Id: I458783f02813ff023b2d142b57b44e5ec3ba30b9 --- diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index 6703f89ed7..a49804644c 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -21,6 +21,9 @@ production. * $wgSquidServersNoPurge now supports the use of Classless Inter-Domain Routing (CIDR) notation to specify contiguous blocks of IPv4 and/or IPv6 addresses that should be trusted to provide X-Forwarded-For headers. +* Preferences 'watchcreations' and 'watchdefault' ("Add pages I create and files + I upload to my watchlist", "Add pages and files I edit to my watchlist") are + now enabled by default. === New features in 1.23 === * ResourceLoader can utilize the Web Storage API to cache modules client-side. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 868c64e341..5163e80cb5 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4034,8 +4034,8 @@ $wgDefaultUserOptions = array( 'uselivepreview' => 0, 'usenewrc' => 0, 'vector-simplesearch' => 1, - 'watchcreations' => 0, - 'watchdefault' => 0, + 'watchcreations' => 1, + 'watchdefault' => 1, 'watchdeletion' => 0, 'watchlistdays' => 3.0, 'watchlisthideanons' => 0, diff --git a/tests/phpunit/includes/api/ApiWatchTest.php b/tests/phpunit/includes/api/ApiWatchTest.php index 028ea9ffb9..87f5190fe0 100644 --- a/tests/phpunit/includes/api/ApiWatchTest.php +++ b/tests/phpunit/includes/api/ApiWatchTest.php @@ -42,6 +42,7 @@ class ApiWatchTest extends ApiTestCase { $data = $this->doApiRequest( array( 'action' => 'query', + 'wllimit' => 'max', 'list' => 'watchlist' ) ); if ( isset( $data[0]['query']['watchlist'] ) ) { @@ -60,6 +61,14 @@ class ApiWatchTest extends ApiTestCase { 'list' => 'watchlist' ), $data ); $this->assertArrayHasKey( 'query', $data[0] ); $this->assertArrayHasKey( 'watchlist', $data[0]['query'] ); + foreach( $data[0]['query']['watchlist'] as $index => $item ) { + // Previous tests may insert an invalid title + // like ":ApiEditPageTest testNonTextEdit", which + // can't be cleared. + if ( strpos( $item['title'] , ':' ) === 0 ) { + unset( $data[0]['query']['watchlist'][$index] ); + } + } $this->assertEquals( 0, count( $data[0]['query']['watchlist'] ) ); return $data;